<%@tag description="Overall Page template" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@attribute name="header" fragment="true"%>
<%@attribute name="footer" fragment="true"%>
<html>
<head>
	<meta charset="utf-8" />
	<title>Konferencje</title>
	<link href="<c:url value="/resources/css/bootstrap.min.css" />" rel="stylesheet" />
	<link href="<c:url value="/resources/css/carousel.css" />" rel="stylesheet" />
	<link href="<c:url value="/resources/css/app.css" />" rel="stylesheet" />
</head>
<body>
    <div class="navbar-wrapper">
      <div class="container">
        <div class="navbar navbar-inverse navbar-static-top" role="navigation">
          <div class="container">
            <div class="navbar-collapse collapse">
              <ul class="nav navbar-nav">
                <li class="active"><a href="<c:url value="/home.htm" />">Strona główna</a></li>
                <li><a href="<c:url value="/conference/list/user.htm" />">Twoje konferencje</a></li>
                <li><a href="#contact">Kontakt</a></li>
                <li class="dropdown">
                	<a href="#" class="dropdown-toggle" data-toggle="dropdown">${user.username} <b class="caret"></b></a>
                  <ul class="dropdown-menu">
                    <li><a href="<c:url value="/logout.htm" />">Wyloguj</a></li>
                  </ul>
                </li>
              </ul>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- Carousel ================================================== -->
    <div id="myCarousel" class="carousel slide" data-ride="carousel">
      
      <!-- Indicators -->
      <ol class="carousel-indicators">
       
      	<c:set var="count" value="0" scope="page" />
      	<c:forEach var="conference" items="${conferencesAll}">
      	<c:choose>
      		<c:when test="${count==0}">
      			<li data-target="#myCarousel" data-slide-to="${count}" class="active"></li>
      		</c:when>
		    <c:otherwise>
				<li data-target="#myCarousel" data-slide-to="${count}"></li>
		    </c:otherwise>
		</c:choose>
		<c:set var="count" value="${count + 1}" scope="page"/>
		</c:forEach>
		
      </ol>
      
      <div class="carousel-inner">
      	<c:set var="count" value="0" scope="page" />
      	<c:forEach var="conference" items="${conferencesAll}">
      	<c:choose>
      		<c:when test="${count==0}">
      			<div class="item active">
      		</c:when>
		    <c:otherwise>
				<div class="item">
		    </c:otherwise>
		</c:choose>
		    	<img data-src="holder.js/900x500/auto/#777:#7a7a7a/text:First slide" alt="First slide">
		            <div class="container">
						<div class="carousel-caption">
			    			<h1>${conference.subject}</h1>
					    	<p><fmt:formatDate pattern="dd-MM-YYYY" value="${conference.date}" /></p>
					    	<p><a class="btn btn-lg btn-primary" href="<c:url value="/conference/view/${conference.id}.htm" />" role="button">Zobacz szczegóły !</a></p>
						</div>
					</div>
		    	</div>
		    	<c:set var="count" value="${count + 1}" scope="page"/>
		</c:forEach>
		</div>
      <a class="left carousel-control" href="#myCarousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
      <a class="right carousel-control" href="#myCarousel" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
    </div><!-- /.carousel -->
    
    
    
    
<div class="container">
	<div id="pageheader">
		<jsp:invoke fragment="header" />
	</div>
	<div id="body">
		<jsp:doBody></jsp:doBody>
	</div>
	<div id="pagefooter">
		<jsp:invoke fragment="footer" />
		<script src="https://code.jquery.com/jquery.js"></script>
		<script src="<c:url value="/resources/js/bootstrap.min.js" />"></script>
		<script src="<c:url value="/resources/js/conferences.js" />"></script>
	</div>
</div>
</body>
</html>